<template name="home_channels">
  <div class="col">
    <div class="channels-content">
      <ul class="nav nav-pills">
        {{> home_channels_tab
          active=true
          title="我创建的频道"
          id="pills-created-channels-tab"
          href="#pills-created-channels"
        }}
        {{> home_channels_tab
          title="我的收藏"
          id="pills-joined-channels-tab"
          href="#pills-joined-channels"
        }}
      </ul>
      <div class="tab-content">
        {{#home_channels_tab_content active=true id="pills-created-channels"}}
          {{> home_channels_created}}
        {{/home_channels_tab_content}}
        {{#home_channels_tab_content id="pills-joined-channels"}}
          {{> home_channels_joined}}
        {{/home_channels_tab_content}}
      </div>
    </div>
  </div>
</template>

<template name="home_channels_tab">
  <li class="nav-item">
    <a class="nav-link{{#if active}} active{{/if}}" id="{{id}}" data-toggle="pill" href="{{href}}" role="tab">
      {{title}}
    </a>
  </li>
</template>

<template name="home_channels_tab_content">
  <div class="tab-pane fade{{#if active}} show active{{/if}}" id="{{id}}" role="tabpanel">
    {{> Template.contentBlock}}
  </div>
</template>